package cn.appsys.dao.appinfo;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import cn.appsys.pojo.AppInfo;

public interface AppInfoMapper {
	
	public int deleteAppLogo(@Param(value="id")Integer id)throws Exception;
	
	public int modify(AppInfo appInfo)throws Exception;

	
	public AppInfo getAppById(int id)throws Exception;
	
	/**
	 * 查询App的信息
	 * 
	 * @param softwareName
	 * @param status
	 * @param flatformId
	 * @param categoryLevel1
	 * @param categoryLevel2
	 * @param categoryLevel3
	 * @param currentPageNo
	 * @param pageSize
	 * @return
	 */
	public List<AppInfo> getAppInfo(
			@Param("softwareName") String softwareName, 
			@Param("status") Integer status,
			@Param("flatformId") Integer flatformId, 
			@Param("categoryLevel1") Integer categoryLevel1,
			@Param("categoryLevel2") Integer categoryLevel2, 
			@Param("categoryLevel3") Integer categoryLevel3,
			@Param("devId") int devId,
			@Param("currentPageNo") int currentPageNo,
			@Param("pageSize") int pageSize);
	

	/**
	 * 获取app的信息数量
	 * 
	 * @param softwareName
	 * @param status
	 * @param flatformId
	 * @param categoryLevel1
	 * @param categoryLevel2
	 * @param categoryLevel3
	 * @param devId
	 * @return
	 */
	public int getCount(@Param("softwareName") String softwareName, 
			@Param("status") Integer status,
			@Param("flatformId") Integer flatformId, 
			@Param("categoryLevel1") Integer categoryLevel1,
			@Param("categoryLevel2") Integer categoryLevel2,
			@Param("categoryLevel3") Integer categoryLevel3,
			@Param("devId") int devId);

	/**
	 * 新增APP基础信息
	 * 
	 * @param appInfo
	 * @return
	 * @throws Exception
	 */
	public int add(AppInfo appInfo) throws Exception;

	/**
	 * 判断软件名称--softwareName是否唯一
	 * 
	 * @param softwareName
	 * @return
	 * @throws Exception
	 */
	public AppInfo getAppsoftwareName(@Param(value = "softwareName") String softwareName) throws Exception;

	/**
	 * 判断APK名称--APPName名字是否唯一
	 * 
	 * @param id
	 * @param APKName
	 * @return
	 * @throws Exception
	 */
	public AppInfo getAppName(@Param(value = "APKName") String APKName) throws Exception;
	
	/**
	 * 查看APP信息
	 * @param id
	 * @param APKName
	 * @return
	 * @throws Exception
	 */
	public AppInfo getAppInfoS(@Param(value="id")Integer id,@Param(value="APKName")String APKName)throws Exception;
	
	/**
	 * 根据appId，更新最新versionId
	 * @param versionId
	 * @param appId
	 * @return
	 * @throws Exception
	 */
	public int updateVersionId(@Param(value="versionId")Integer versionId,@Param(value="id")Integer appId)throws Exception;
	
	/**
	 * 跟新APP状态
	 * @param status
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int updateSatus(@Param(value="status")Integer status,@Param(value="id")Integer id)throws Exception;
}
